{extend name="main/index" /}
{block name="main"}

<div class="content-page">
    <!-- ============================================================== -->
    <!-- Start Content here -->
    <!-- ============================================================== -->
    <div class="content">
        <!-- Page Heading Start -->
        <div class="page-heading">
            <h1><i class='fa fa-table'></i> 前台用户管理表</h1>
            <h3>用于前台用户的用户添加</h3></div>
        <!-- Page Heading End-->                <!-- Your awesome content goes here -->
        <div class="row">
            <div class="col-md-12">
                <div class="widget">
                    <div class="widget-header transparent">
                        <h2><strong>Toolbar</strong> CRUD Table</h2>
                        <div class="additional-btn">
                            <a href="#" class="hidden reload"><i class="icon-ccw-1"></i></a>
                            <a href="#" class="widget-toggle"><i class="icon-down-open-2"></i></a>
                            <a href="#" class="widget-close"><i class="icon-cancel-3"></i></a>
                        </div>
                    </div>
                    <div class="widget-content">
                        <div class="data-table-toolbar">
                            <div class="row">
                                <div class="col-md-4">
                                    <!--<form role="form">
                                        <input type="text" class="form-control" placeholder="Search...">
                                    </form>-->
                                </div>
                                <div class="col-md-2">
                                   <!-- <div class="">
                                        <a class="btn btn-success" href=""><i class="fa "></i>搜索笔记</a>
                                    </div>-->
                                </div>
                            </div>
                        </div>

                        <div class="table-responsive">
                            <table data-sortable class="table table-hover table-striped">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>单元ID</th>
                                    <th>用户ID</th>
                                    <th>创建时间</th>
                                    <th>修改时间</th>
                                    <th width="300">内容</th>
                                    <th data-sortable="false">是否公开</th>
                                </tr>
                                </thead>

                                {volist name="data" key="k" id="v"}
                                <tbody>
                                <tr class="oneNote{$v['id']}">
                                    <td>{$v['id']}</td>
                                    <td>{$v['uniteid']}<strong></strong></td>
                                    <td>{$v['uid']}</td>
                                    <td>{$v['mktime']}</td>
                                    <td>{$v['updatetime']}</td>
                                    <td width="">{$v['content']}</td>
                                    <td><span class="label label-success">{$v['display']}</span></td>
                                    <td>
                                        <div class="btn-group btn-group-xs">
                                            <a onclick="delajax({$v['id']})" data-toggle="tooltip" title="删除" class="btn btn-default"><i class="fa fa-power-off"></i>
                                            </a>
                                            <!--<a data-toggle="tooltip"  href="/userAddRole" title="笔记详情" class="btn btn-default"><i class="fa fa-edit"></i></a>-->
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                                {/volist}
                            </table>
                        </div>

                        <div class="data-table-toolbar">
                            <div>
                                <ul>
                                    {volist name='page' id='user'}
                                    <li> {$user.nickname}</li>
                                    {/volist}
                                </ul>
                            </div>
                            {$page}
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <!-- Footer Start -->
        <footer>
            Huban Creative &copy; 2014
            <div class="footer-links pull-right">
                <a href="#">About</a><a href="#">Support</a><a href="#">Terms of Service</a><a href="#">Legal</a><a
                    href="#">Help</a><a href="#">Contact Us</a>
            </div>
        </footer>
        <!-- Footer End -->
    </div>
    <!-- ============================================================== -->
    <!-- End content here -->
    <!-- ============================================================== -->

</div>


{js href="/static/index/js/jquery-1.8.3.min.js"}
{js href="/static/layer/layer.js"}
<script>
    function delajax(id){
        layer.confirm('你确定要删除该笔记?', {icon: 3, title:'提示'}, function(index){
            $.ajax({
                type : 'post',
                dataType: 'json',
                url : '/adminDelNotes',
                data: {
                    'nid' : id
                },
                success : function(data)
                {
                    if(data == 200){
                        layer.msg('删除成功!!!', {icon: 1});
                        history.go(0);
                    } else {
                        layer.msg('删除失败!!!');
                    }
                    layer.close(index);
                }
            });
        })
    }
</script>

{/block}